<?php
$media_right .= "<fieldset id=\"folderview\">\n<legend>Dateien</legend>\n";
$media_right .= "<div class=\"path\">\n".mediaGeneratePath()."</div><br /><br />\n";
$media_right .= "<form action=\"".$media_linker."&amp;folder=".$showfolder."\" method=\"post\">\n";

$media_filelist = array();
if($media_upper_possible) {
  $media_filelist[] = array(false, "..", true);
}
foreach(createFolderList($media_dir.$showfolder) as $f) {
  $media_filelist[] = array(false, $f);
}
foreach(createFileList($media_dir.$showfolder, array()) as $f) {
  $media_filelist[] = array(true, $f);
}

if(count($media_filelist)==0) {
  $media_right .= "<div class=\"cpanel\">\n<p>Es sind keine Dateien vorhanden</p>\n</div><div class=\"clr\"></div>\n";
} else {
  $media_cpanel = new ControlPanel();
  foreach($media_filelist as $f) {
    $ch = "";
    $li = "";
    $ti = "";
    $l2 = "";
    $sp = "";
    if($f[1]!="..") {
      $ch = "mediaselectfiles[]|".$f[1];
    }
    if($f[0]) {
      $li = $media_linker."&amp;folder=".$showfolder."&amp;file2open=".$f[1];
      $ti = longkicker($f[1], 19)." :: Datei &ouml;ffnen";
      $l2 = mediaGetThumbnailImage($f[1]);
      $sp = longkicker($f[1], 18);
    } else {
      $g = $showfolder.$f[1];
      if(isset($f[2]) && $f[2]) {
        $g = $media_upper;
      }
      $li = $media_linker."&amp;folder=".$g."/";
      if($f[1] == "..") {
        $ti = longkicker($f[1], 19)." :: Eine Verzeichnisebene nach oben";
      } else {
        $ti = longkicker($f[1], 19)." :: Ordner &ouml;ffnen";
      }
      $l2 = "<img src=\"css/images/folderbig.png\" alt=\"Ordner\" />";
      $sp = longkicker($f[1], 18);
    }
    $media_cpanel->add($li, $ti, $l2, $sp, $ch);
  }
  $media_right .= $media_cpanel->output();
}

$media_right .= "<div class=\"startmediaactions\">Dateien: ".$media_checkout_count."; Durch Dateien verbrauchter Speicherplatz: ".formFileSize($media_checkout_size, 2)."<br />\n<br />\n";
$media_right .= "<button name=\"mediabutton\" value=\"delete\" type=\"submit\" title=\"L&ouml;schen :: Ausgew&auml;hlte Dateien/Ordner l&ouml;schen\" class=\"tooltip\">\n<img src=\"css/images/delete.gif\" alt=\"trashbin\"> L&ouml;schen</button>\n &nbsp; \n";
$media_right .= "<button name=\"mediabutton\" value=\"rename\" type=\"submit\" title=\"Umbenennen :: Ausgew&auml;hlte Dateien/Ordner umbenennen\" class=\"tooltip\">\n<img src=\"css/images/edit.gif\" alt=\"pencil\"> Umbenennen</button>\n";
$media_right .= "</div>\n";
$media_right .= "</form>\n";
$media_right .= "</fieldset>\n";

$media_actions .= "<img src=\"css/images/newfolder.gif\" alt=\"Neuer Ordner\" />\n<a href=\"".$media_linker."&amp;folder=".$showfolder."&amp;action=newfolder\" class=\"tooltip\" title=\"Neuer Ordner :: Hier k&ouml;nnen Sie einen neuen Ordner erstellen\">Neuer Ordner</a>\n<br />\n";
$media_actions .= "\n<a href=\"".$media_linker."&amp;folder=".$showfolder."&amp;action=upload\" class=\"tooltip\" title=\"Upload :: Hier k&ouml;nnen Sie eine Datei in das aktuelle Verzeichnis hochladen\">Upload</a>\n<br />\n";
?>